﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StudentForm.aspx.cs" Inherits="StudentForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            margin-left: 55px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    <h2>STUDENT RECORDS</h2>
    <asp:FormView ID="FormView1" runat="server" AllowPaging="True" 
        BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" 
        CellPadding="4" CellSpacing="6" DataKeyNames="Student_ID" 
        DataSourceID="StudentDataSource" ForeColor="Black" GridLines="Both" 
        Height="262px" onpageindexchanging="FormView1_PageIndexChanging" Width="493px">
        <EditItemTemplate>
            Student_ID:
            <asp:Label ID="Student_IDLabel1" runat="server" 
                Text='<%# Eval("Student_ID") %>' />
            <br />
            First_Name:
            <asp:TextBox ID="First_NameTextBox" runat="server" 
                Text='<%# Bind("First_Name") %>' />
            <br />
            Last_Name:
            <asp:TextBox ID="Last_NameTextBox" runat="server" 
                Text='<%# Bind("Last_Name") %>' />
            <br />
            GPA:
            <asp:TextBox ID="GPATextBox" runat="server" Text='<%# Bind("GPA") %>' />
            <br />
            Email:
            <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
            <br />
            Faculty_ID:
            <asp:TextBox ID="Faculty_IDTextBox" runat="server" 
                Text='<%# Bind("Faculty_ID") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <EditRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <InsertItemTemplate>
            Student_ID:
            <asp:TextBox ID="Student_IDTextBox" runat="server" 
                Text='<%# Bind("Student_ID") %>' />
            <br />
            First_Name:
            <asp:TextBox ID="First_NameTextBox" runat="server" 
                Text='<%# Bind("First_Name") %>' />
            <br />
            Last_Name:
            <asp:TextBox ID="Last_NameTextBox" runat="server" 
                Text='<%# Bind("Last_Name") %>' />
            <br />
            GPA:
            <asp:TextBox ID="GPATextBox" runat="server" Text='<%# Bind("GPA") %>' />
            <br />
            Email:
            <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
            <br />
            Faculty_ID:
            <asp:TextBox ID="Faculty_IDTextBox" runat="server" 
                Text='<%# Bind("Faculty_ID") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            Student_ID:
            <asp:Label ID="Student_IDLabel" runat="server" 
                Text='<%# Eval("Student_ID") %>' />
            <br />
            <br />
            First_Name:
            <asp:Label ID="First_NameLabel" runat="server" 
                Text='<%# Bind("First_Name") %>' />
            <br />
            <br />
            Last_Name:
            <asp:Label ID="Last_NameLabel" runat="server" Text='<%# Bind("Last_Name") %>' />
            <br />
            <br />
            GPA:
            <asp:Label ID="GPALabel" runat="server" Text='<%# Bind("GPA") %>' />
            <br />
            <br />
            Email:
            <asp:Label ID="EmailLabel" runat="server" Text='<%# Bind("Email") %>' />
            <br />
            <br />    

            Faculty_ID:
            <asp:Label ID="Faculty_IDLabel" runat="server" 
                Text='<%# Bind("Faculty_ID") %>' />
            <br />
   

        </ItemTemplate>
        <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
        <RowStyle BackColor="White" />
    </asp:FormView>
    <asp:SqlDataSource ID="StudentDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:EC AssignmentConnectionString %>" 
        SelectCommand="SELECT Students.[Student_ID],[First_Name],[Last_Name],[GPA],[Email],[Faculty_ID]
                           FROM Students 
                           LEFT JOIN StudentMembers 
                           ON Students.Student_ID = StudentMembers.Student_ID">
    </asp:SqlDataSource>
    <asp:Button ID="Back" runat="server" onclick="Back_Click" Text="Back" 
        Width="105px" />
    <asp:Button ID="HomeBtn" runat="server" CssClass="style1" 
        onclick="HomeBtn_Click" Text="Home" Width="99px" />
    </form>
</body>
</html>
